# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=shards
pkgver=0.18.0
pkgrel=0
_minitestver=0.5.0
_molinillover=0.2.0
pkgdesc="Dependency manager for the Crystal language"
url="https://github.com/crystal-lang/shards"
arch="x86_64 aarch64"
license="Apache-2.0"
depends="crystal>=0.35.0 git"
makedepends="yaml-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/crystal-lang/shards/archive/v$pkgver.tar.gz
	minitest.cr-$_minitestver.tar.gz::https://github.com/ysbaddaden/minitest.cr/archive/v$_minitestver.tar.gz
	molinillo-$_molinillover.tar.gz::https://github.com/crystal-lang/crystal-molinillo/archive/v$_molinillover.tar.gz
	"

export CRYSTAL_CACHE_DIR="$srcdir/.cache"

prepare() {
	default_prepare

	mkdir -p lib
	ln -s ../../minitest.cr-$_minitestver lib/minitest
	ln -s ../../crystal-molinillo-$_molinillover lib/molinillo
}

build() {
	make
}

check() {
	export EMAIL="Test User <user@example.com>"
	make test_integration
}

package() {
	make install DESTDIR="$pkgdir" PREFIX=/usr
}

sha512sums="
99f325792ab13bb1301e29b5b9cc09b10bb081c85d5f67e1a2d9dddd9b1118e23048630ffb7a8a740924b119f774cf22a8f3f223338a82a5c242460bb68f2eb7  shards-0.18.0.tar.gz
ecd0661340f4d5fa61a730c0ad4e9b8463fe5df32a54c979f28dfe663ed2e40ff19b212e18bb81c89275039474f8ec1072b3c2c5fdf5396973f8a9f641b653cb  minitest.cr-0.5.0.tar.gz
7c00a6a3ee4864b712ad8b703557f10498ba0b25491a55ae2f6c02d574034ec5bf8b87df777c3d34eb9cc4c87eebdcf6567c153e9edf3bc3c1b9ac4306ce3dc2  molinillo-0.2.0.tar.gz
"
